#ifndef STOCK_H_
#define STOCK_H_

#include <vector>
#include <map>
#include "Product.h"

using std::vector;

class Stock{

public:
	Stock(vector < Product * > productList); //constructor
	int getItemPrice(string id);
	int getItemStock(string id);
	void addItem(string id, int quantity);
	void reduceItem(string id, int quantity);
	string getProductName(int index);
	map <int, string> getItemsHeader(); //get all buffered items' header name
	map <int, int> getItemsHeaderLength(); //get all buffered items' colume width
	map <int, string> getItemsDetails(); //get all buffered items' data
	int setBufferItem(string id); //set a specific item searched by ID into buffer
	int setBufferItem(int productType); //set a item of a specific type into buffer
	int setBufferItem(int productType, int compareFactor); //set all items of a specific type into buffer
	int setBufferItem(int productType, int compareFactor, int threshold); //set all items of a specific type with stock lower than threshold into buffer
private:
	string static productName[]; //name of products
	string static productClassName[]; //name of product classes
	vector < Product * > bufferProductList; //buffer of product for display or modify
	vector < Product * > productList; //Actual storage
};

#endif